package yunc.checkData.pojo;

import yunc.checkData.utils.IOutil;

import java.util.ArrayList;
import java.util.List;

public class ZKFile {
    TitleTide title;
    TideData data;
    List<DescTide> desc;
    public ZKFile(){}

    public ZKFile(String filePath){
        List<String> strings = IOutil.read(filePath);
        //初始化Title
        this.title=new TitleTide(strings.get(0));
        //System.out.println(strings.get(0));

        //初始化数据
        List<String> dataList = new ArrayList<>();
        for (int i = 1; i < strings.size()-1; i++) {
            //System.out.println(strings.get(i));
            dataList.add(strings.get(i));
        }
        this.data=new TideData(this.title,dataList);

        //初始化描述
        List<String> descList = new ArrayList<>();
        //System.out.println(strings.get(strings.size() - 1));
        this.desc.add(new DescTide(strings.get(strings.size()-1)));
    }

    TideData getData() {return data;};
}
